package net.cyue.nest.nestjava.core;

import net.cyue.nest.nestjava.core.adapter.AbstractHTTPAdapter;
import net.cyue.nest.nestjava.core.injector.NestContainer;

public class NestFactory
{

  public static
  <TServerAdapter extends AbstractHTTPAdapter<TServer>, TServer>
  NestApplication<TServerAdapter>
  create(
    Class<?> appModuleClass,
    TServerAdapter httpAdapter
    ) {
    return NestFactory.create(appModuleClass, httpAdapter, new NestApplicationOption());
  }
  public static
  <TServerAdapter extends AbstractHTTPAdapter<TServer>, TServer>
  NestApplication<TServerAdapter>
  create(
    Class<?> appModuleClass,
    TServerAdapter httpAdapter,
    NestApplicationOption option
  ) {
    NestContainer nestContainer = new NestContainer();
    return new NestApplication<>(appModuleClass, nestContainer, httpAdapter);
  }
}

